import actionSheet from './index.vue'

actionSheet.install = function (Vue) {
	Vue.prototype.$showActionSheet = (itemList, callback = () => ({})) => {
		const ToastConstructor = Vue.extend(actionSheet)
		const instance = new ToastConstructor({
			el: document.createElement('div'),
			data: {
				itemList
			},
			methods: {
				callback
			}
		})
		const dom = instance.$el
		const wrap = document.querySelector('#action-sheet-wrapper')

		document.body.appendChild(dom)
	}
}

export default actionSheet